/**
 *
 */
package com.china.lee.sqlppCrake;

/**
 * The Class SqlPPCrake.
 * 
 * @author li-l
 */
public class SqlPPCrake {

	/**
	 * The main method.
	 * 
	 * @param args the arguments
	 */
	public static void main(String[] args) {
		System.out.println(getPas("TheOne", "Lee", "CNC", " "));

	}

	/**
	 * getPas.
	 * 
	 * @param paramString1 the param string1
	 * @param paramString2 the param string2
	 * @param paramString3 the param string3
	 * @param paramString4 the param string4
	 * @return pas
	 */
	private static String getPas(String paramString1, String paramString2, String paramString3, String paramString4) {
		int i = 0;
		paramString1 = paramString1.trim();
		paramString1 = "sqlinform"
				+ paramString1
				+ "sqlinform"
				+ new StringBuffer(paramString1).reverse();
		for (int j = 0; j < paramString1.toString().length(); ++j) {
			i += paramString1.toString().charAt(j)
					* (j + 1);
		}
		paramString1 = paramString2.trim();
		paramString1 = "sqlinform"
				+ paramString1
				+ "sqlinform"
				+ new StringBuffer(paramString1).reverse();
		for (int j = 0; j < paramString1.toString().length(); ++j) {
			i += paramString1.toString().charAt(j)
					* (j + 1);
		}
		paramString1 = paramString3.trim();
		paramString1 = "sqlinform"
				+ paramString1
				+ "sqlinform"
				+ new StringBuffer(paramString1).reverse();
		for (int j = 0; j < paramString1.toString().length(); ++j) {
			i += paramString1.toString().charAt(j)
					* (j + 1);
		}
		if ((paramString1 = paramString4.trim()).length() > 0) {
			paramString1 = "sqlinform"
					+ paramString1
					+ "sqlinform"
					+ new StringBuffer(paramString1).reverse();
			for (int j = 0; j < paramString1.toString().length(); ++j) {
				i += paramString1.toString().charAt(j)
						* (j + 1);
			}
		}
		String str2 = new StringBuffer(Integer.toString(i)).reverse().toString();
		paramString1 = Character.toString((char) (i % 16 + 65)).toUpperCase();
		paramString2 = Character.toString((char) (i % 11 + 65)).toLowerCase();
		paramString3 = Character.toString((char) (i % 13 + 65)).toUpperCase();
		paramString4 = Character.toString((char) (i % 17 + 65)).toUpperCase();
		String str3 = Character.toString((char) (i % 7 + 65)).toLowerCase();
		String str1 = Character.toString((char) (i % 10 + 65)).toUpperCase();
		return paramString1
				+ paramString2
				+ paramString3
				+ "-"
				+ str2
				+ "-"
				+ paramString4
				+ str3
				+ str1;
	}
}
